home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / misc / gfront11.lha / GUIFront / Demos / Source / ThreeBut.c < prev    next >
C/C++ Source or Header  |  1994-11-01  |  2KB  |  77 lines

  1.  
  2. /* ThreeBut.c - Three simple buttons
  3.  *
  4.  * This is a GUIFront example GUI. To build an example, compile and link this
  5.  * file with Generic.o (also supplied).
  6.  * Everything prefixed with DEMO_ is exported to Generic.o.
  7.  */
  8.  
  9. #include <libraries/guifront.h>
  10.  
  11. /* First, some Gadget ID's */
  12.  
  13. enum
  14. {
  15.     GID_BUTTON1,
  16.     GID_BUTTON2,
  17.     GID_BUTTON3,
  18. };
  19.  
  20. /* Now, the GadgetSpec's we'll be needing for this GUI */
  21.  
  22. static GadgetSpec gadgetspecs[] =
  23. {
  24.     {BUTTON_KIND, 0,0, {0,0,0,0, "_A button",       NULL, GID_BUTTON1, PLACETEXT_IN}, NULL, GS_DefaultTags},
  25.     {BUTTON_KIND, 0,0, {0,0,0,0, "Another _button", NULL, GID_BUTTON2, PLACETEXT_IN}, NULL, GS_DefaultTags},
  26.     {BUTTON_KIND, 0,0, {0,0,0,0, "_One more",       NULL, GID_BUTTON3, PLACETEXT_IN}, NULL, GS_DefaultTags},
  27. };
  28.  
  29. /* Now, we group all of these GadgetSpecs into an array of pointers, so the
  30.  * layout engine can locate gadgets merely by their Gadget IDs.
  31.  */
  32.  
  33. GadgetSpec *DEMO_GadgetSpecList[] =
  34. {
  35.     &gadgetspecs[0], &gadgetspecs[1], &gadgetspecs[2], NULL
  36. };
  37.  
  38. /* Finally, the layout tag list itself. This is where most of the work is
  39.  * done. This list completely describes how the above gadgets are arranged
  40.  * in groups in the GUI.
  41.  */
  42.  
  43. ULONG DEMO_LayoutList[] =
  44. {
  45.     GUIL_Flags, GUILF_PropShare | GUILF_EqualWidth,
  46.  
  47.     GUIL_GadgetSpecID, GID_BUTTON1,
  48.     GUIL_GadgetSpecID, GID_BUTTON2,
  49.     GUIL_GadgetSpecID, GID_BUTTON3,
  50.  
  51.     TAG_DONE,
  52. };
  53.  
  54. /* Obligatory version tag */
  55.  
  56. static const char ver[] = "$VER: ThreeBut 1.0 " __AMIGADATE__;
  57.  
  58. /* Now, some globals used by Generic.o during the call to GF_CreateGUIA() */
  59.  
  60. /* The initial orientation of the GUI. In this case, it's vertical. This means
  61.  * the three button gadgets, which we just grouped together, will be placed
  62.  * in a vertical group. Alternatively, we could have used GUIL_HorizGroup
  63.  * to make the initial orientation horizontal (surprise :-)
  64.  */
  65.  
  66. int DEMO_InitialOrientation = GUIL_VertGroup;
  67.  
  68. STRPTR DEMO_WindowTitle = "Threebut GUI";
  69. STRPTR DEMO_AppID       = "Threebut";
  70.  
  71. STRPTR DEMO_Version     = "1.0",
  72.        DEMO_LongDesc    = "Demo program - Three buttons",
  73.        DEMO_Author      = "Michael Berg",
  74.        DEMO_Date        = __AMIGADATE__;
  75.  
  76. BOOL   DEMO_Backfill    = FALSE;
  77.